package ru.mirent.entity.listeners.platform;

import org.junit.jupiter.api.extension.*;
import ru.mirent.BaseSuit;
import ru.mirent.entity.notifications.*;

public class ExtensionCallbackLifecycle extends BaseSuit implements BeforeAllCallback, AfterAllCallback,
        BeforeEachCallback, AfterEachCallback,
        BeforeTestExecutionCallback, AfterTestExecutionCallback {

    @Override
    public void beforeAll(ExtensionContext extensionContext) {
        fixtureObserverService.sendAction(BeforeAllCallbackNotification.class);
    }

    @Override
    public void afterAll(ExtensionContext extensionContext) {
        fixtureObserverService.sendAction(AfterAllCallbackNotification.class);
    }

    @Override
    public void beforeEach(ExtensionContext context) {
        fixtureObserverService.sendAction(BeforeEachCallbackNotification.class);
    }

    @Override
    public void afterEach(ExtensionContext context) {
        fixtureObserverService.sendAction(AfterEachCallbackNotification.class);
    }

    @Override
    public void beforeTestExecution(ExtensionContext extensionContext) {
        fixtureObserverService.sendAction(BeforeTestExecutionCallbackNotification.class);
    }

    @Override
    public void afterTestExecution(ExtensionContext extensionContext) {
        fixtureObserverService.sendAction(AfterTestExecutionCallbackNotification.class);
    }
}
